/*
 * Copyright (C) 2016 AMT [FEATURE-POI]
 *
 *
 * Remark Table:
 * ----------------------------------------------------------------------
 * | Date         |    Author            |  Task/Bug ID   |  Remark     |
 * ----------------------------------------------------------------------
 * | 2018-06-23   |                      | Task:          | create      |
 * ----------------------------------------------------------------------
 * |              |                      |                |             |
 * ----------------------------------------------------------------------
 *
 *
 */

package android.poi;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * SYNC with: vendor/cns_gateway_utils/aidl/android/poi/ParcelableAreaInfo.cpp
 * @author 
 *
 */
public class ParcelableAreaInfo implements Parcelable {
    
    public String province;
    public String city;
    public String area;
    public double longitude = 0;
    public double latitude = 0;
    
    public ParcelableAreaInfo() {}
    
    public ParcelableAreaInfo(String province, String city, String area, double longitude, double latitude) {
        this.province = province;
        this.city = city;
        this.area = area;
        this.longitude = longitude;
        this.latitude = latitude;
    }
    
    public int describeContents() { return 0; }
    
    
    public void writeToParcel(Parcel dest, int flags) {
    	dest.writeString(province);
    	dest.writeString(city);
    	dest.writeString(area);
        dest.writeDouble(longitude);
        dest.writeDouble(latitude);
    }
    
    public void readFromParcel(Parcel source) {
        this.province = source.readString();
        this.city = source.readString();
        this.area = source.readString();
        this.longitude = source.readDouble();
        this.latitude = source.readDouble();
    }
    
    public String toString() {
        return "ParcelableAreaInfo(province:" + province + ", city:" + city + ", area:" + area +
        		", longitude:" + longitude + ", latitude:" + latitude + ")";
    }
    
    public static final Parcelable.Creator<ParcelableAreaInfo> CREATOR =
            new Parcelable.Creator<ParcelableAreaInfo>() {
        public ParcelableAreaInfo createFromParcel(Parcel source) {
            String tmp_province = source.readString();
            String tmp_city = source.readString();
            String tmp_area = source.readString();
            double tmp_longitude = source.readDouble();
            double tmp_latitude = source.readDouble();
            return new ParcelableAreaInfo(tmp_province, tmp_city, tmp_area, tmp_longitude, tmp_latitude);
        }

        public ParcelableAreaInfo[] newArray(int size) {
            return new ParcelableAreaInfo[size];
        }
    };

}
